<?php
/**
 * Created by PhpStorm.
 * User: hehecat
 * Date: 2018/7/10
 * Time: 13:35
 */

namespace app\api\controller;


use app\api\model\PictureModel;
use think\Controller;

class Picture extends Controller
{

    function reply() {
        $userid = input('get.userid');
        $pictureid =input('get.pictureid');
        $content =input('get.content');
        $sessionid = input('get.sessionid');

        $redis = getRedis();
        if ($sessionid!='' && $sessionid == $redis->get($userid)) {
            $model = new PictureModel();
            $result = $model->reply($userid,$pictureid,$content);
            return json_encode($result);
        }
        return  json_encode(['error'=>'sessionid无效']);
    }

}